import { ref, onMounted } from "vue";

//获取鼠标位置的:保存的数据
let x = ref(-1);
let y = ref(-1);
//获取鼠标位置的:事件函数
const getMousePoint = (e: MouseEvent) => {
  x.value = e.clientX;
  y.value = e.clientY;
};
//获取鼠标位置的:生命周期函数
onMounted(() => {
  console.log("请移动鼠标,可以查看鼠标的位置信息");
});

export default {
  x,
  y,
  getMousePoint
};
